package light.mvc.model.register;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import light.mvc.model.base.IdEntity;
import light.mvc.model.item.Tmedicine;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "medicine_prescription")
@DynamicInsert(true)
@DynamicUpdate(true)
public class TmedicinePrescription extends IdEntity implements java.io.Serializable{
	private static final long serialVersionUID = 1L;
	
	private Tprescription prescription;
	private Tmedicine medicine;
	
	private Integer medicineNum;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "medicine_id")
	public Tmedicine getMedicine() {
		return medicine;
	}
	public void setMedicine(Tmedicine medicine) {
		this.medicine = medicine;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prescription_id")
	public Tprescription getPrescription() {
		return prescription;
	}
	public void setPrescription(Tprescription prescription) {
		this.prescription = prescription;
	}
	public Integer getMedicineNum() {
		return medicineNum;
	}
	public void setMedicineNum(Integer medicineNum) {
		this.medicineNum = medicineNum;
	}
	
	
}
